package com.demo1.controller;

import com.demo1.entity.Order;
import com.demo1.entity.R;
import com.demo1.service.IOrderService;
import com.demo1.service.IPetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/order")
public class OrderController
{
    @Autowired
    private IOrderService orderService;

    @Autowired
    private IPetService petService;

    /**
     * 查询所有订单信息
     */
    @GetMapping("/findAll")
    public R findAll(){
        List<Order> order = orderService.list();
        Map<String,Object> map = new HashMap<>();
        map.put("message",order);
        return R.ok(map);
    }
}
